package com.study.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.common.core.domin.Result;
import com.study.pojo.User;
import com.study.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author csc
 * @Date 2023/8/30 14:02
 * @PackageName:com.cscloser.controller
 * @ClassName: UserController
 * @Description: TODO
 * @Version 1.0
 */

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/{pageNum}/{limit}")
    public Result page(@PathVariable Integer pageNum, @PathVariable Integer limit){
        Page<User> pageParam = new Page<>(pageNum,limit);
        IPage<User> page1 = userService.page(pageParam);
        return Result.ok(page1);
    }






}
